﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace mtdsharp
{
    class Stop
    {
        private string id;
        public string ID
        {
            get { return id; }
        }

        private string name;
        public string Name
        {
            get { return name; }
        }

        private double latitude;
        public double Latitude
        {
            get { return latitude; }
        }

        private double longitude;
        public double Longitude
        {
            get { return longitude; }
        }

        public Stop(string gtfsLine)
        {
            // Split up the comma-separated values from the GTFS data line
            string[] gtfsElements = gtfsLine.Split(',');

            // Set the internal properties
            this.id = gtfsElements[0];
            this.name = gtfsElements[2];
            this.latitude = Convert.ToDouble(gtfsElements[4]);
            this.longitude = Convert.ToDouble(gtfsElements[5]);
        }

        public override string ToString() { return name; }
    }
}
